Recipe for include-what-you-use and rpath problem #sdk
Good morning everybody,
I would like to include IWYU ( https://include-what-you-use.org/ ) in my SDK, but I couldn't find a recipe, so I'm trying to write my own. With the help of devtool , I came to something like this:
LICENSE = "NCSA"
LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=59d01ad98720f3c50d6a8a0ef3108c88 \
file://iwyu-check-license-header.py;md5=cdc4ab52c0b26e216cbf434649d30403"SRC_URI = "git://github.com/include-what-you-use/include-what-you-use.git;protocol=https;branch=clang_10"
PV = "0.14+git${SRCPV}"
SRCREV = "0.14"
S = "${WORKDIR}/git"
DEPENDS = "clang"
inherit cmake python3native
BBCLASSEXTEND_append = " \
nativesdk \
"The application seems to compile fine, but in do_package step it fails with this error message:
ERROR: nativesdk-include-what-you-use-0.14+git999-r0 do_package: chrpath command failed with exit code 7:
/build/archimede/tmp/work/x86_64-nativesdk-pokysdk-linux/nativesdk-include-what-you-use/0.14+git999-r0/package/opt/Delcon/sdk/delconos-archimede-raspberrypi3-64/sysroots/x86_64-pokysdk-linux/usr/bin/include-what-you-use: RPATH=$ORIGIN/../lib:/build/archimede/tmp/work/x86_64-nativesdk-pokysdk-linux/nativesdk-include-what-you-use/0.14+git999-r0/recipe-sysroot/opt/Delcon/sdk/delconos-archimede-raspberrypi3-64/sysroots/x86_64-pokysdk-linux/usr/lib
new rpath '$ORIGIN/../lib:$ORIGIN/../../../../../../../../build/archimede/tmp/work/x86_64-nativesdk-pokysdk-linux/nativesdk-include-what-you-use/0.14+git999-r0/recipe-sysroot/opt/Delcon/sdk/delconos-archimede-raspberrypi3-64/sysroots/x86_64-pokysdk-linux/usr/lib' too large; maximum length 220
ERROR: Logfile of failure stored in: /build/archimede/tmp/work/x86_64-nativesdk-pokysdk-linux/nativesdk-include-what-you-use/0.14+git999-r0/temp/log.do_package.1595
ERROR: Task (virtual:nativesdk:/build/archimede/workspace/recipes/include-what-you-use/include-what-you-use_git.bb:do_package) failed with exit code '1'
NOTE: Tasks Summary: Attempted 1033 tasks of which 1024 didn't need to be rerun and 1 failed.
You can see full bitbake logs attached.
It seems to me that the error happens in perform_packagecopy function, in invocation of rpath_replace.
The problem seems to be similar to the one reported on u-boot-mkimage in topic 61277548 ( https://lists.yoctoproject.org/g/meta-freescale/topic/61277548 ) , 4 years ago.
I tried to apply something similar to u-boot-mkimage recipe commit 5d3df78367be0afbfe001b4fa776a98a82e6ce54 ( http://cgit.openembedded.org/openembedded-core/commit/?id=5d3df78367be0afbfe001b4fa776a98a82e6ce54 ) proposed as solution in above topic, but with no success: I came to the conclusion that cmake class is already doing the correct job here, as shown by log files attached.
How can I resolve this RPATH problem?
Thanks in advance,
Francesco
I was able to make it work correctly enabling CMAKE_SKIP_RPATH. Here the working full recipe:
LICENSE = "NCSA"
LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=59d01ad98720f3c50d6a8a0ef3108c88 \
file://iwyu-check-license-header.py;md5=cdc4ab52c0b26e216cbf434649d30403"SRC_URI = "git://github.com/include-what-you-use/include-what-you-use.git;protocol=https;branch=clang_10"
PV = "0.14+git${SRCPV}"
SRCREV = "0.14"
S = "${WORKDIR}/git"
DEPENDS = "clang"
inherit cmake python3native
EXTRA_OECMAKE_append_class-nativesdk = " \ -DCMAKE_SKIP_RPATH:BOOL=ON \ "
BBCLASSEXTEND_append = " \ nativesdk \ "
Quoted 2 lines · Francesco Cusolito
I was able to make it work correctly enabling |CMAKE_SKIP_RPATH|. Here the working full recipe:
this is fine, if you are interested submit it as a patch to include in metadata in meta-python
Quoted 7 lines
|LICENSE = "NCSA"
LIC_FILES_CHKSUM= "file://LICENSE.TXT;md5=59d01ad98720f3c50d6a8a0ef3108c88 \ file://iwyu-check-license-header.py;md5=cdc4ab52c0b26e216cbf434649d30403"SRC_URI= "git://github.com/include-what-you-use/include-what-you-use.git;protocol=https;branch=clang_10" PV = "0.14+git${SRCPV}" SRCREV = "0.14" S = "${WORKDIR}/git" DEPENDS = "clang" inherit cmake python3native EXTRA_OECMAKE_append_class-nativesdk = " \ -DCMAKE_SKIP_RPATH:BOOL=ON \ "BBCLASSEXTEND_append= " \ nativesdk \ " |